#include <bits/stdc++.h>

using namespace std;

vector<vector<int>> permuteUnique(vector<int>& nums);
void dfs(vector<int>& nums, int idx, vector<int>& perm);

int main()
{
	return 0;
}

vector<vector<int>> res;
bitset<12> vis;
vector<vector<int>> permuteUnique(vector<int>& nums)
{
	vector<int> perm;
	sort(nums.begin(), nums.end());
	dfs(nums, 0, perm);
	return res;
}

void dfs(vector<int>& nums, int idx, vector<int>& perm)
{
	int length = nums.size();
	if (idx == length) {
		res.emplace_back(perm);
		return;
	}
	for (int i = 0; i < length; i++) {
		if (vis[i] || (i > 0 && nums[i] == nums[i - 1] && !vis[i - 1]))
			continue;
		perm.emplace_back(nums[i]);
		vis[i] = 1;
		dfs(nums, idx + 1, perm);
		vis[i] = 0;
		perm.pop_back();
	}
}
